// @ts-nocheck
import axios from "axios";
import http from "../../../utils/Axios";

export interface IEventList {
  categoryCompleteName: string;
  code: string;
  name: string;
  parentCode: string;
  parentName: string;
  sorting: number;
  categoryChild?: IEventList[];
}

export async function getEventType() {
  return http<IEventList[]>(
    "post",
    `/api/seh-grid/bCategoryNew/gridCategoryTree?code=0`,
    {}
  );
}

export async function getTypes(prams) {
  return http<IEventList[]>(
    "get",
    `/app/keeper-special/charm/resident/index/govern/getCommunnityType`,
    prams
  );
}

interface IUploadImage {
  file: File;
}

export async function upLoadImage(prams: IUploadImage) {
  const formData = new FormData();
  formData.append("file", prams.file);

  return await axios.post("/api/seh-resource/attach/uploads", formData, {
    headers: {
      "Content-type": "multipart/form-data",
    },
  });
}


export async function putEventReportByFromData(parmas: IRequestEventReport) {
  return http(
    "post",
    "/app/keeper-special/charm/resident/index/govern/communityEchoWall",
    parmas
  );
}

